create table VisaType
(
	 [VisaTypeId] int identity(1, 1) primary key
	,[VisaTypeName] nvarchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE VisaTypeGet
	@VisaTypeId int
AS
SELECT *
FROM [VisaType]
WHERE [VisaType].[VisaTypeId] = @VisaTypeId	
GO

CREATE PROCEDURE VisaTypeList
AS
SELECT *
FROM [VisaType]
ORDER BY VisaTypeId DESC
GO

CREATE PROCEDURE VisaTypeInsert
	 @VisaTypeName nvarchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO VisaType (
	 [VisaTypeName]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @VisaTypeName
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE VisaTypeUpdate
	@VisaTypeId int, 
	@VisaTypeName nvarchar(128), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE VisaType SET
	   [VisaTypeName] = @VisaTypeName
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [VisaType].[VisaTypeId] = @VisaTypeId
GO

CREATE PROCEDURE VisaTypeDelete
	@VisaTypeId int 
AS
DELETE FROM VisaType
WHERE [VisaType].[VisaTypeId] = @VisaTypeId
GO